package com.mofeng.myshop.mapper;

import com.mofeng.myshop.domain.po.CommodityCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 商品分类 Mapper 接口
 * </p>
 *
 * @author MoFeng
 * @since 2024-04-17
 */
public interface CommodityCategoryMapper extends BaseMapper<CommodityCategory> {

    @Select({"<script>",
            "SELECT * FROM `tb_commodity_category`",
            "WHERE  1=1 ",
            "<if test='projectId != null'>",
            "AND `project_id` = #{projectId}",
            "</if>",
            "<if test='delete != null'>",
            "AND `delete` = #{delete}",
            "</if>",
            "ORDER BY `order_index` ",
            "</script>"})
    List<CommodityCategory> findList(@Param("projectId") Long projectId,@Param("delete") String delete);
}
